package com.citycloud.ccuap.tc.admin.entity;

import com.citycloud.ccuap.commons.json.adapter.DateFormatAdapter;
import com.citycloud.ccuap.framework.service.Model;
import com.google.gson.annotations.JsonAdapter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.mybatis.annotations.*;
import org.springframework.data.mybatis.annotations.Id.GenerationType;
import org.springframework.data.repository.query.parser.Part.Type;

import java.util.Date;

/***
 * @className SysDeptmentMerge
 * @author wangyj
 * @Date 2019/12/3 10:06
 * @description
 */
@Data
@ApiModel("部门合表")
@Entity(table = "vw_deptment_merge")
public class SysDeptmentMerge implements Model {
    private static final long serialVersionUID = 1L;
    
    @ApiModelProperty(value = "部门ID ")
    @Column(name = "dept_id")
    @Condition
    @Id(strategy = GenerationType.AUTO)
    private Long deptId;
    
    
    @ApiModelProperty(value = "父ID")
    @Column(name = "pid")
    @Condition
    private Long pid;
    
    @ApiModelProperty(value = "来源标识ID")
    @Column(name = "org_guid")
    @Condition
    private String orgGuid;
    
    @ApiModelProperty(value = "部门编号")
    @Column(name = "dept_code")
    @Condition(type = Type.LIKE)
    private String deptCode;
    
    @ApiModelProperty(value = "部门名称")
    @Column(name = "dept_name")
    @Condition(type = Type.LIKE)
    private String deptName;
    
    @ApiModelProperty(value = "部门全称")
    @Column(name = "full_name")
    @Condition(type = Type.LIKE)
    private String fullName;
    
    @ApiModelProperty(value = "部门简称")
    @Column(name = "short_name")
    @Condition(type = Type.LIKE)
    private String shortName;
    
    
    @ApiModelProperty(value = "排序")
    @Column(name = "order_no")
    @Condition
    private Long orderNo;
    
    @ApiModelProperty(value = "部门职能")
    @Column(name = "dept_function")
    @Condition(type = Type.LIKE)
    private String deptFunction;
    
    @ApiModelProperty(value = "部门类型")
    @Column(name = "dept_type")
    @Condition
    private Short deptType;
    
    @ApiModelProperty(value = "地址")
    @Column(name = "address")
    @Condition
    private String address;
    
    
    @ApiModelProperty(value = "邮编")
    @Column(name = "post_code")
    @Condition
    private String postCode;
    
    @ApiModelProperty(value = "联系人")
    @Column(name = "link_man")
    @Condition
    private String linkMan;
    
    @ApiModelProperty(value = "联系电话")
    @Column(name = "telephone")
    @Condition(type = Type.LIKE)
    private String telephone;
    
    @ApiModelProperty(value = "部门创建时间")
    @JsonAdapter(DateFormatAdapter.class)
    @Column(name = "build_date")
    @Conditions({@Condition, @Condition(type = Type.GREATER_THAN_EQUAL, properties = {"startBuildDate"}), @Condition(type = Type.LESS_THAN, properties = {"endBuildDate"})})
    private Date buildDate;
    
    @ApiModelProperty(value = "数据状态 1有效  0无效")
    @Column(name = "data_status")
    @Condition
    private Short dataStatus;
    
    @ApiModelProperty(value = "创建人")
    @Column(name = "creator")
    @Condition(type = Type.LIKE)
    private String creator;
    
    @ApiModelProperty(value = "创建时间")
    @Column(name = "created_time")
    @Conditions({@Condition, @Condition(type = Type.GREATER_THAN_EQUAL, properties = {"startCreatedTime"}), @Condition(type = Type.LESS_THAN, properties = {"endCreatedTime"})})
    private Date createdTime;
    @Column(name = "updator")
    @Condition(type = Type.LIKE)
    
    @ApiModelProperty(value = "更新人")
    private String updator;
    @Column(name = "updated_time")
    @Conditions({@Condition, @Condition(type = Type.GREATER_THAN_EQUAL, properties = {"startUpdatedTime"}), @Condition(type = Type.LESS_THAN, properties = {"endUpdatedTime"})})
    
    @ApiModelProperty(value = "更新时间")
    private Date updatedTime;
    
    @ApiModelProperty(value = "备注")
    @Column(name = "remark")
    @Condition(type = Type.LIKE)
    private String remark;
    
    @ApiModelProperty(value = "JSON字段")
    @Column(name = "json")
    @Condition(type = Type.LIKE)
    private String json;
    
}